<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>Form</title>
	<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
	<div id="demo">
		<input v-model="message" placeholder="请输入">
		<p>Message is :  {{message}}</p>
		<button v-on:click="counter += 1">加 1</button>
		<p>上面的按钮被点击了{{counter}} 次。</p>
		<br>
		<button v-on:click="greet">Greet</button>
	</div>
	<script type="text/javascript">
		var vm = new Vue({
			el: '#demo',
			data: {
				message: 'Hello',
				counter:0,
				name: 'Vue.js'
			},
			methods: {
				greet: function(event){
					alert('Hello' + this.name +'!')
					if (event) {
						alert(event.target.tagName)
					}
				}
			}
		})
		/*vm.greet()*/
	</script>
</body>
</html>